package com.powervision.mvvmdemo.ui.viewmodel

import com.powervision.base.base.BaseViewModel
import com.powervision.http.observer.StateLiveData
import com.powervision.mvvmdemo.ui.model.KnowledgeModel
import com.powervision.mvvmdemo.ui.repository.WxArticleRepository

/**
 * @auth: njb
 * @date: 2021/12/22 9:43
 * @desc: 描述
 */
class WxArticleViewModel : BaseViewModel() {
    private val mWxArticleRepository by lazy { WxArticleRepository() }
    val mWxArticleLiveData = StateLiveData<List<KnowledgeModel.DataBean>>()

    fun wxArticle() {
        launchWithLoading(
            requestBlock = {
                mWxArticleRepository.wxArticle()
            }, resultCallback = {
                mWxArticleLiveData.value = it
            })
    }
}